<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="p" uri="/WEB-INF/tld/page.tld" %>
<script type="text/javascript">
	$(function() {
		$("input[name='teacherId']").click(function() {
			var teacherId = $(this).val();
			$("#student-table-div").load("/teach/loadStudents/"+teacherId);
		})
	})
</script>

<!-- content starts -->
<div>
	<ul class="breadcrumb">
	    <li>教师学生管理</li>
	    <li>教师学生管理</li>
	</ul>
</div>

<div class="row">
    <div class="ch-container">
	<div class="row">
    <div class="box col-md-5">
        <div class="box-inner">
            <div class="box-header well" data-original-title="">
                <h2><i class="glyphicon glyphicon-tasks"></i> 教师列表</h2>

                <div class="box-icon">
                    <a href="#" class="btn btn-setting btn-round btn-default"><i
                            class="glyphicon glyphicon-cog"></i></a>
                    <a href="#" class="btn btn-minimize btn-round btn-default"><i
                            class="glyphicon glyphicon-chevron-up"></i></a>
                    <a href="#" class="btn btn-close btn-round btn-default"><i
                            class="glyphicon glyphicon-remove"></i></a>
                </div>
            </div>
            <div class="box-content">
            	<!-- <a href="javascript:;" class="btn btn-sm btn-primary" onclick="addSiblingDict();">新增同级</a> -->
            	<!-- <a href="javascript:;" class="btn btn-sm btn-primary" onclick="addSonDict();">新增</a>
            	<a href="javascript:;" class="btn btn-sm btn-primary" onclick="updateDict();">修改</a>
            	<a href="javascript:;" class="btn btn-sm btn-primary" onclick="delDict();">删除</a> -->
            	<p/>
            	<table id="teacher-table" class="table table-striped table-bordered bootstrap-datatable datatable responsive">
			    <thead>
			    <tr>
			    	<th></th>
			        <th>登录名</th>
			        <th>用户名</th>
			        <th>创建时间</th>
			        <!-- <th>操作</th> -->
			    </tr>
			    </thead>
			    <tbody>
			    <c:forEach items="${teacherPage.list }" var="teacher">
			    <tr>
			    	<td class="center"><input type="radio" name="teacherId" value="${teacher.id }"></td>
			        <td class="center">${teacher.loginname }</td>
			        <td class="center">${teacher.username }</td>
			        <td class="center">${teacher.create_time }</td>
			        <%-- <td class="center">
			            <!-- <a class="btn btn-success" href="#">
			                <i class="glyphicon glyphicon-zoom-in icon-white"></i>
			                View
			            </a> -->
			            <a class="btn btn-info" href="javascript:;" onclick='editUser("${user.id}");'>
			                <i class="glyphicon glyphicon-edit icon-white"></i> 编辑
			            </a>
			            <a class="btn btn-danger" href="javascript:;" onclick='delUser("${user.id}");'>
			                <i class="glyphicon glyphicon-trash icon-white"></i> 删除
			            </a>
			        </td> --%>
			    </tr>
			    </c:forEach>
			    </tbody>
			    </table>
            </div>
            <div class="col-md-5">
				<div class="dataTables_info">第${teacherPage.pageNumber }/${teacherPage.totalPage }页,共${teacherPage.totalRow }条记录</div>
			</div>
			<p:page pageNumber="${teacherPage.pageNumber }" totalPage="${teacherPage.totalPage }"
				 totalRow="${teacherPage.totalRow }" width="5"/>
		 </div>
	</div>
    <!--/span-->

    <div id="dict-edit-div" class="box col-md-6">
        <div class="box-inner">
            <div class="box-header well">
                <h2><i class="glyphicon glyphicon-eye-open"></i> 学生列表</h2>

                <div class="box-icon">
                    <a href="#" class="btn btn-setting btn-round btn-default"><i
                            class="glyphicon glyphicon-cog"></i></a>
                    <a href="#" class="btn btn-minimize btn-round btn-default"><i
                            class="glyphicon glyphicon-chevron-up"></i></a>
                    <a href="#" class="btn btn-close btn-round btn-default"><i
                            class="glyphicon glyphicon-remove"></i></a>
                </div>
            </div>
            <div id="student-table-div">
            <jsp:include page="student_table.jsp"/>
            </div>
        </div>
    </div>
    <!--/span-->

</div><!--/row-->
</div>